<?php
/**
 *@author Connor <caokang@foxmail.com>
 *@todo
 *@link www.zeevin.com
 */
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/space.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/space_log.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/scrollbar.js"></script>
<style>
html{background:#dcdfe4;}
</style>
</head>
  <div class="spaceblog_list">
      <ul>
      	<?php foreach($posts['rows'] as $v):?>
            <li>
                  <h3><?php echo CHtml::link(CHtml::encode(mb_substr($v->subject,0,37)),array('post/edit','id'=>$v->id),array('title'=>CHtml::encode($v->subject)));?> <?php echo substr($v->ctime,0,10);?></h3>
                  <p><?php echo CHtml::encode($v->sub_content),'......';?></p>
            </li>
        <?php endforeach;?> 
      </ul>
</div>
<script type="text/javascript">
$(document).ready(function(){
var page=1;
var num=<?php echo $posts['total_num'];?>;
$(".spacelog .log_topbtn").live("click",function(){
      if(page>1){
        page--;
        $(".log_content").load('?r=space/blog&id=<?php echo $_GET[id]?>&page='+page);
      }
        
});
$(".spacelog .log_bottombtn").live("click",function(){
     if(page<num){
      page++;
     $(".log_content").load('?r=space/blog&id=<?php echo $_GET[id]?>&page='+page);
    ;}
})
})
</script>